<link rel="stylesheet" type="text/css" href="{:CSS}datetimepicker.min.css">
<div class="row"><h3 class="page-header">信息中心<small>/<gt name='info.id' value='0'>修改<else/>添加</gt>信息</small></h3></div>
<div class="row">
	<div class="panel panel-default">
		<div class="panel-body">
			<form role="form" id="myform" method="post"  class="form-horizontal">
			    <div class="form-group">
			        <label class="col-sm-3 control-label">新闻标题：<span class="c-red">*</span></label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control required" name="title" value="{$info.title}" maxlength='100'>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">副标题：</label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control" name="subtitle" value="{$info.subtitle}" maxlength='100'>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">所属分类：</label>
			        <div class="col-sm-4 input-group">
			        	<select class="form-control" name="pid">
			        		<volist name='list' id='list'>
			        			<option value="{$list.id}" <eq name='info.pid' value='$list["id"]'>selected</eq>>{:str_pad('', $list['num'] * 18 - 18, '&nbsp;&nbsp;&nbsp;')}|-{$list.name}</option>
			        		</volist>
						</select>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">作者：</label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control" name="author" value="{$Think.session.adminInfo.name}" readonly maxlength='20'>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">来源：</label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control" name="origin" value="{$info.origin}" maxlength='20'>
			        </div>
			    </div>
			    <div class="form-group">
			        <label class="col-sm-3 control-label">发布时间：</label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control datepick required" name="times" value="<empty name='info.times'>{:date('Y-m-d H:i')}<else/>{$info.times|date='Y-m-d H:i', ###}</empty>" readonly="readonly">
			        </div>
			    </div>
			    <div class="form-group">
                    <label class="col-sm-3 control-label">新闻图片：</label>
                    <div class="col-sm-4 input-group">
                        <div class="uploadify-div">
                        	<notempty name='info.pic'>
		       					<li><img src="{$info.pic}"><input type="hidden" value="{$info.pic}" name="pic"><span style="color:blue;cursor:pointer;" class="uploadifyDel">删除</span></li>
		       				</notempty>
					    </div> 
			       		<button type="button" class="upload" id="upload">选择图片</button>
                    </div>
                </div>
                <div class="form-group">
			        <label class="col-sm-3 control-label">排序：</label>
			        <div class="col-sm-4 input-group">
			        	<input class="form-control digits" name="sort" value="{$info.sort|default=100}">
			        </div>
			    </div>
			    <div class="form-group">
					<label  class="col-sm-3 control-label">状态：</label>
					<div class="col-sm-4 input-group">
			            <label class="radio-inline">
			                <input type="radio" value="1" name="status" <neq name="info.status" value="0">checked</neq>>启用
			            </label>
			            <label class="radio-inline">
			                <input type="radio" value="0" name="status" <eq name="info.status" value="0">checked</eq>>禁用
			            </label>
		            </div>
		        </div>
		       	<div class="form-group">
		           <label class="col-sm-3 control-label">新闻简介：</label>
		           <div class="col-sm-4 input-group">
		           		<textarea rows="3" class="form-control" name="desc">{$info.desc}</textarea>
		           </div>
		        </div>
		        <div class="form-group">
		           <label class="col-sm-3 control-label">新闻内容：</label>
		           <div class="col-sm-4 input-group">
		           		<textarea rows="3" class="form-control keditor" name="content">{$info.content}</textarea>
		           </div>
		        </div>
		        <input type='hidden' name='id' value='{$info.id}'>
		        <div class="form-group">
                    <div class="col-sm-offset-3 col-sm-5">
				        <button class="btn btn-primary" type="submit">提交</button>
				       	<a href="{:U('News/index')}"><button class=" btn btn-default" type="button">返回</button></a>
		       		</div>
		       	</div>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript" src="{:JS}daterangepicker.min.js"></script>
<script type="text/javascript">
$(".datepick").datetimepicker({format : "yyyy-mm-dd hh:ii", minView : 0, autoclose : true});
</script>